<?php

/**
 * Frecuencia form base class.
 *
 * @method Frecuencia getObject() Returns the current form's model object
 *
 * @package    SistemaRutasEc
 * @subpackage form
 * @author     Your name here
 * @version    SVN: $Id: sfDoctrineFormGeneratedTemplate.php 29553 2010-05-20 14:33:00Z Kris.Wallsmith $
 */
abstract class BaseFrecuenciaForm extends BaseFormDoctrine
{
  public function setup()
  {
    $this->setWidgets(array(
      'id_fr'       => new sfWidgetFormInputHidden(),
      'id_ru'       => new sfWidgetFormInputText(),
      'hora'        => new sfWidgetFormTime(),
      'horaretorno' => new sfWidgetFormTime(),
      'especial'    => new sfWidgetFormInputCheckbox(),
      'prioridad'   => new sfWidgetFormInputText(),
      'activo'      => new sfWidgetFormInputCheckbox(),
    ));

    $this->setValidators(array(
      'id_fr'       => new sfValidatorChoice(array('choices' => array($this->getObject()->get('id_fr')), 'empty_value' => $this->getObject()->get('id_fr'), 'required' => false)),
      'id_ru'       => new sfValidatorInteger(),
      'hora'        => new sfValidatorTime(array('required' => false)),
      'horaretorno' => new sfValidatorTime(array('required' => false)),
      'especial'    => new sfValidatorBoolean(array('required' => false)),
      'prioridad'   => new sfValidatorInteger(),
      'activo'      => new sfValidatorBoolean(array('required' => false)),
    ));

    $this->widgetSchema->setNameFormat('frecuencia[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    $this->setupInheritance();

    parent::setup();
  }

  public function getModelName()
  {
    return 'Frecuencia';
  }

}
